﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class WelcomeControl : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(Session[EClass.ESession.Username.ToString()] == null)
        {
            _multiView.ActiveViewIndex = 0;
        }
        else
        {
            _lnkUsername.Text = Session[EClass.ESession.Username.ToString()].ToString();
            _multiView.ActiveViewIndex = 1;
        }
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Session[EClass.ESession.Username.ToString()] = null;
        HttpCookie cookie = new HttpCookie(EClass.ECookie.ChkIdUser.ToString());
        cookie.Expires = DateTime.Now.AddMilliseconds(-1);
        Response.SetCookie(cookie);
        Response.Redirect("Homepage.aspx");
    }
}
